package com.springboot.application.main;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

/**
 * <p>web项目</p>
 * <p>1. 相当于 web.xml 配置</p>
 * @author yangz
 * @version latest
 * @date 2015/8/16
 */
@Configuration
@ComponentScan("com")
@EntityScan("com")
@EnableJpaRepositories("com")
@EnableAutoConfiguration
public class WebApplication extends SpringBootServletInitializer {

    //------ application servlet filter 均在此注册-------//

    //------启动配置-------//
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(WebApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(WebApplication.class, args);
    }
}
